![]() |
|
The di_open
function opens the device for communication. This function has to be called before any of the other functions can be called.
int di_open(devno); |
|
unsigned devno; |
/* device ID */ |
devno
is different for each instrument.
DI_NO_ERR | No error |
DI_ALREADY_OPEN_ERR | Device is already open |
DI_RESET_ERR | Invalid parallel port number or serial device did not echo stop command |
DI_INFO_ERR | Cannot obtain parallel port address or invalid IP address format |
DI_CLOSE_ERR | Parallel port is in use by another process |
DI_DRIVER_ERR | Device driver not found |
DI_COMM_ERR | Communication error |
none
See Device IDs and Drivers for a list of DATAQ Instruments, Inc. Device IDs and drivers under different Windows™ Operating Systems.
#include "200sdk.h" |
|
int errcode; |
|
char errstr[255]; |
|
main() |
|
{ |
|
if(errcode = di_open(0xFFFD3A04)){ |
/* open a DI-158 installed at COM4 with a Baud rate of 460800 */ |
di_strerr(errcode,errstr); |
|
printf("%s",errstr); |
|
} |
|
else |
|
printf("Device installed successfully.....\n"); |
|
di_close(); |
|
} |
Copyright © DATAQ Instruments, Inc.